home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / Creating I230367182001.psc / Form1.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  2001-07-17  |  7.6 KB  |  232 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "create odd masks."
  4.    ClientHeight    =   6015
  5.    ClientLeft      =   60
  6.    ClientTop       =   345
  7.    ClientWidth     =   8055
  8.    LinkTopic       =   "Form1"
  9.    MaxButton       =   0   'False
  10.    ScaleHeight     =   6015
  11.    ScaleWidth      =   8055
  12.    StartUpPosition =   2  'CenterScreen
  13.    Begin VB.Frame Frame1 
  14.       Caption         =   "Angle Setup:"
  15.       BeginProperty Font 
  16.          Name            =   "Tahoma"
  17.          Size            =   8.25
  18.          Charset         =   0
  19.          Weight          =   400
  20.          Underline       =   0   'False
  21.          Italic          =   0   'False
  22.          Strikethrough   =   0   'False
  23.       EndProperty
  24.       Height          =   1095
  25.       Left            =   0
  26.       TabIndex        =   1
  27.       Top             =   4920
  28.       Width           =   8055
  29.       Begin VB.CommandButton Command1 
  30.          Height          =   495
  31.          Left            =   7080
  32.          Picture         =   "Form1.frx":0000
  33.          Style           =   1  'Graphical
  34.          TabIndex        =   11
  35.          Top             =   360
  36.          Width           =   735
  37.       End
  38.       Begin VB.TextBox Text8 
  39.          BeginProperty Font 
  40.             Name            =   "Tahoma"
  41.             Size            =   6.75
  42.             Charset         =   0
  43.             Weight          =   400
  44.             Underline       =   0   'False
  45.             Italic          =   0   'False
  46.             Strikethrough   =   0   'False
  47.          EndProperty
  48.          Height          =   285
  49.          Left            =   6240
  50.          TabIndex        =   10
  51.          Text            =   "20"
  52.          Top             =   480
  53.          Width           =   615
  54.       End
  55.       Begin VB.TextBox Text7 
  56.          BeginProperty Font 
  57.             Name            =   "Tahoma"
  58.             Size            =   6.75
  59.             Charset         =   0
  60.             Weight          =   400
  61.             Underline       =   0   'False
  62.             Italic          =   0   'False
  63.             Strikethrough   =   0   'False
  64.          EndProperty
  65.          Height          =   285
  66.          Left            =   5520
  67.          TabIndex        =   9
  68.          Text            =   "10"
  69.          Top             =   480
  70.          Width           =   615
  71.       End
  72.       Begin VB.TextBox Text6 
  73.          BeginProperty Font 
  74.             Name            =   "Tahoma"
  75.             Size            =   6.75
  76.             Charset         =   0
  77.             Weight          =   400
  78.             Underline       =   0   'False
  79.             Italic          =   0   'False
  80.             Strikethrough   =   0   'False
  81.          EndProperty
  82.          Height          =   285
  83.          Left            =   4440
  84.          TabIndex        =   8
  85.          Text            =   "10"
  86.          Top             =   480
  87.          Width           =   615
  88.       End
  89.       Begin VB.TextBox Text5 
  90.          BeginProperty Font 
  91.             Name            =   "Tahoma"
  92.             Size            =   6.75
  93.             Charset         =   0
  94.             Weight          =   400
  95.             Underline       =   0   'False
  96.             Italic          =   0   'False
  97.             Strikethrough   =   0   'False
  98.          EndProperty
  99.          Height          =   285
  100.          Left            =   3720
  101.          TabIndex        =   7
  102.          Text            =   "300"
  103.          Top             =   480
  104.          Width           =   615
  105.       End
  106.       Begin VB.TextBox Text4 
  107.          BeginProperty Font 
  108.             Name            =   "Tahoma"
  109.             Size            =   6.75
  110.             Charset         =   0
  111.             Weight          =   400
  112.             Underline       =   0   'False
  113.             Italic          =   0   'False
  114.             Strikethrough   =   0   'False
  115.          EndProperty
  116.          Height          =   285
  117.          Left            =   2640
  118.          TabIndex        =   6
  119.          Text            =   "450"
  120.          Top             =   480
  121.          Width           =   615
  122.       End
  123.       Begin VB.TextBox Text3 
  124.          BeginProperty Font 
  125.             Name            =   "Tahoma"
  126.             Size            =   6.75
  127.             Charset         =   0
  128.             Weight          =   400
  129.             Underline       =   0   'False
  130.             Italic          =   0   'False
  131.             Strikethrough   =   0   'False
  132.          EndProperty
  133.          Height          =   285
  134.          Left            =   1920
  135.          TabIndex        =   5
  136.          Text            =   "45"
  137.          Top             =   480
  138.          Width           =   615
  139.       End
  140.       Begin VB.TextBox Text2 
  141.          BeginProperty Font 
  142.             Name            =   "Tahoma"
  143.             Size            =   6.75
  144.             Charset         =   0
  145.             Weight          =   400
  146.             Underline       =   0   'False
  147.             Italic          =   0   'False
  148.             Strikethrough   =   0   'False
  149.          EndProperty
  150.          Height          =   285
  151.          Left            =   840
  152.          TabIndex        =   4
  153.          Text            =   "566"
  154.          Top             =   480
  155.          Width           =   615
  156.       End
  157.       Begin VB.TextBox Text1 
  158.          BeginProperty Font 
  159.             Name            =   "Tahoma"
  160.             Size            =   6.75
  161.             Charset         =   0
  162.             Weight          =   400
  163.             Underline       =   0   'False
  164.             Italic          =   0   'False
  165.             Strikethrough   =   0   'False
  166.          EndProperty
  167.          Height          =   285
  168.          Left            =   120
  169.          TabIndex        =   3
  170.          Text            =   "1"
  171.          Top             =   480
  172.          Width           =   615
  173.       End
  174.       Begin VB.Label Label1 
  175.          Caption         =   "Vertices:"
  176.          BeginProperty Font 
  177.             Name            =   "Tahoma"
  178.             Size            =   6.75
  179.             Charset         =   0
  180.             Weight          =   400
  181.             Underline       =   0   'False
  182.             Italic          =   0   'False
  183.             Strikethrough   =   0   'False
  184.          EndProperty
  185.          Height          =   255
  186.          Left            =   120
  187.          TabIndex        =   2
  188.          Top             =   240
  189.          Width           =   1095
  190.       End
  191.    End
  192.    Begin VB.PictureBox Picture1 
  193.       BeginProperty Font 
  194.          Name            =   "Tahoma"
  195.          Size            =   6.75
  196.          Charset         =   0
  197.          Weight          =   400
  198.          Underline       =   0   'False
  199.          Italic          =   0   'False
  200.          Strikethrough   =   0   'False
  201.       EndProperty
  202.       Height          =   4815
  203.       Left            =   0
  204.       Picture         =   "Form1.frx":27A2
  205.       ScaleHeight     =   4755
  206.       ScaleWidth      =   7995
  207.       TabIndex        =   0
  208.       Top             =   0
  209.       Width           =   8055
  210.    End
  211. Attribute VB_Name = "Form1"
  212. Attribute VB_GlobalNameSpace = False
  213. Attribute VB_Creatable = False
  214. Attribute VB_PredeclaredId = True
  215. Attribute VB_Exposed = False
  216. Private Sub Command1_Click()
  217. Dim vertex(0 To 3) As POINT_TYPE
  218. Dim hRgn As Long
  219. Dim retval As Long
  220. 'build the array for the angles from user input
  221. vertex(0).x = Val(Text1): vertex(0).y = Val(Text2)
  222. vertex(1).x = Val(Text3): vertex(1).y = Val(Text4)
  223. vertex(2).x = Val(Text5): vertex(2).y = Val(Text6)
  224. vertex(3).x = Val(Text7): vertex(3).y = Val(Text8)
  225. 'create the polygon
  226. hRgn = CreatePolygonRgn(vertex(0), 4, ALTERNATE)
  227. 'set the mask
  228. retval = SetWindowRgn(Picture1.hWnd, hRgn, True)
  229. 'delete the unneeded region
  230. retval = DeleteObject(hRgn)
  231. End Sub
  232.